﻿using System;
using YArchitech.Revit.Electric.Common;

namespace HYElectricSetting
{
	public class ConduitFittingFilter : IFilterFamilyObject
	{
		public ConduitFittingFilter(int category)
		{
			this.category = category;
		}

		bool IFilterFamilyObject.IsMatch(DbFamilyObject familyObject)
		{
			bool flag = familyObject == null;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				foreach (DbFamilyParameter dbFamilyParameter in familyObject.Parameters)
				{
					bool flag2 = dbFamilyParameter.Value == null;
					if (!flag2)
					{
						bool flag3 = "SubCategory" == dbFamilyParameter.Name && this.category == Convert.ToInt32(dbFamilyParameter.Value);
						if (flag3)
						{
							return true;
						}
					}
				}
				result = false;
			}
			return result;
		}

		private const string paramName = "SubCategory";

		private int category = 0;
	}
}
